package com.ff.bd;

import android.content.Context;
import android.util.Log;
import com.baidu.mobads.sdk.api.AdSettings;
import com.baidu.mobads.sdk.api.BDAdConfig;
import com.bykv.vk.openvk.mediation.bridge.custom.MediationCustomInitLoader;
import com.bykv.vk.openvk.mediation.custom.MediationCustomInitConfig;
import yyee.llee.mmee.wifimaster.utils.ThreadUtils;
import com.manager.core.pl190.host668.NConst;
import java.util.Map;

public class BdAdapterConfig extends MediationCustomInitLoader {

    private static final String TAG = NConst.TAG + BdAdapterConfig.class.getSimpleName();

    @Override
    public void initializeADN(Context context, MediationCustomInitConfig mediationCustomInitConfig, Map<String, Object> localExtra) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
        for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
            for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                    int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                }
            }
        }
        Log.i(TAG, "call initializeADN localExtra = " + localExtra);
        ThreadUtils.runOnThreadPool(new Runnable() {

            @Override
            public void run() {
                int passwordfdare32432qresafdsagda32 = 123456;
                int[] arrfdahiuryeqwfjdasopufdag = new int[] { 9, 4 };
                int lenfdajipureqopufdag = arrfdahiuryeqwfjdasopufdag.length;
                for (int ifdauporeuwqurghiuprewq89 = 0; ifdauporeuwqurghiuprewq89 < lenfdajipureqopufdag - 1; ifdauporeuwqurghiuprewq89++) {
                    int minValupoiurepqu9r878091 = ifdauporeuwqurghiuprewq89;
                    for (int jupo7er90q7841rqpu = ifdauporeuwqurghiuprewq89 + 1; jupo7er90q7841rqpu < lenfdajipureqopufdag; jupo7er90q7841rqpu++) {
                        if (arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] > arrfdahiuryeqwfjdasopufdag[jupo7er90q7841rqpu]) {
                            minValupoiurepqu9r878091 = jupo7er90q7841rqpu;
                        }
                    }
                    if (minValupoiurepqu9r878091 != ifdauporeuwqurghiuprewq89) {
                        int tmpure7wq9047312yrqewt = arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89];
                        arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89] = arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091];
                        arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] = tmpure7wq9047312yrqewt;
                    }
                }
                BDAdConfig bdAdConfig = new BDAdConfig.Builder().setAppsid(mediationCustomInitConfig.getAppId()).setDebug(false).setBDAdInitListener(new BDAdConfig.BDAdInitListener() {

                    @Override
                    public void success() {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
                        int keydasopuerqnfdazcveq = 4;
                        int lowupoeqfda7073fdal = 0;
                        int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
                        int middledaiueprnvznfewqip = 0;
                        if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
                            int adfajpouqregjbdipug = 1;
                        } else {
                            while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                                middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                                if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                                    // 比关键字大则关键字在左区域
                                    highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                                } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                                    // 比关键字小则关键字在右区域
                                    lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                                } else {
                                }
                            }
                        }
                        Log.d(TAG, "百度SDK初始化成功");
                    }

                    @Override
                    public void fail() {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
                        for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
                            int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
                            while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                                jfdsaipureqwrewq7843791298047ui--;
                            }
                            arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
                        }
                        Log.d(TAG, "百度SDK初始化失败");
                    }
                }).build(context);
                bdAdConfig.init();
                callInitSuccess();
            }
        });
    }

    @Override
    public String getNetworkSdkVersion() {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
        for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
            for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                    int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                }
            }
        }
        Log.d(TAG, "NetworkSdkVersion>>" + AdSettings.getSDKVersion());
        return AdSettings.getSDKVersion();
    }
}
